from typing import List, Union

from sympy import Equality, Expr


class SolveTriangle:
    """This is class that we can use to solve triangle."""

    def __init__(
        self,
        conditions: List[Union[Equality, Expr]],
        *,
        sss: dict,
        aaa: dict,
        **kwargs: dict,
    ) -> None:
        """
        The 'conditions' is a list of equations, which will condition the triangle.
        'sss' is a dictionary, which will tell us the three sides' symbols and length if it could give.
        'aaa' is simular with 'sss'.

        """
        # TODO
        # check the Input
        if len(sss) == len(aaa) == 3:
            pass
        else:
            raise IOError(
                "We should know the triangle's all atoms' name. So sides dictionary and angles dictionary should be 3 length."
            )

        # TODO
        # simplify the conditions.
        pass

        # TODO
        # deliver the conditions' simplified result to sss and aaa.
        pass

        def get_symbol_and_counts(atoms_dict: dict) -> List[list, int]:
            symbols = []
            count = 0
            # python在3.6以后dict的key开始按有序的方式存储
            for k, value in atoms_dict.items():
                symbols.append(k)
                if value != None:
                    count += 1
            return [symbols, count]

        side_symbols, side_value_count = get_symbol_and_counts(sss)
        angle_symbols, angle_value_count = get_symbol_and_counts(aaa)

        # the situation of sas


print("hello debugger!")
